import os
import sys

SYS_PATH = ('{APP_ROOT}/lib',
            '{APP_ROOT}/lib/site-packages')

APP_ROOT = os.path.dirname(os.path.abspath(__file__))


def update_sys_path(app_root, sys_paths):
    i = 0
    for path_entry in sys_paths:
        new_path = path_entry.\
            replace('/', os.sep).\
            replace('{APP_ROOT}', app_root)
        sys.path.insert(i, new_path)
